package com.IODemo.ByteStream;

import java.io.FileInputStream;

import java.io.IOException;

/**
 * @Author milian
 * @Date 2021/7/27 0027 18:48
 */
public class demo2 {
    public static void main(String[] args) throws IOException {
        FileInputStream fis = new FileInputStream("H:\\test\\input.txt");
        int by;
        while ((by=fis.read())!=-1){
            System.out.println((char)by);
        }
        fis.close();
        FileInputStream fis1 = new FileInputStream("H:\\test\\input.txt");
        byte[] bys=new byte[1024];
        int len;
        while ((len=fis1.read(bys))!=-1){
            System.out.println(new String(bys,0,len));
        }
        fis1.close();
    }
}
